package com.xinchen.aiowaste.ui.activity

import android.os.Bundle
import androidx.navigation.fragment.findNavController
import com.maple.utils.widget.update.CustomUpdateParser
import com.xinchen.aiowaste.R
import com.xinchen.aiowaste.app.Config
import com.xinchen.aiowaste.base.BaseActivity
import com.xuexiang.xupdate.XUpdate

class AccountActivity : BaseActivity() {

    override fun getLayoutId(): Int = R.layout.activity_account

    override fun initData(savedInstanceState: Bundle?) {
        val navHost = supportFragmentManager.findFragmentById(R.id.fragment)
        val navController = navHost?.findNavController()
        navController?.setGraph(R.navigation.navigation_account)
        navController?.navigateUp()

       // checkVersion()
    }

    private fun checkVersion() {
        val updateUrl = "http://114.116.13.190:8180/common/app-update/latestVersion?type=${Config.getAppName()}"
        XUpdate.newBuild(this)
            .updateUrl(updateUrl)
            .isGet(true)
            .updateParser(CustomUpdateParser())
            .update()
    }
}